//package com.hzncc.scaffold.controller.other;
//
//
//import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
//import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
//import io.swagger.annotations.Api;
//import io.swagger.annotations.ApiOperation;
//import org.springframework.web.bind.annotation.*;
//
//import javax.annotation.Resource;
//import java.util.List;
//
//import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
//import com.hzncc.scaffold.core.ResultT;
//import com.hzncc.scaffold.service.OneplusxtrainingService;
//import com.hzncc.scaffold.entity.Other.Oneplusxtraining;
//import org.springframework.web.bind.annotation.RestController;
//
///**
// * <p>
// * 1+X练习表 前端控制器
// * </p>
// *
// * @author DrunkBear
// * @since 2022-04-27
// */
//@RestController
//@RequestMapping("/oneplusxtraining")
//@Api(tags = "1+X练习表接口")
//public class OneplusxtrainingController {
//
//    @Resource
//    private OneplusxtrainingService oneplusxtrainingService;
//
//    /**
//     * 查询表中所有信息
//     *
//     * @return
//     */
//    @GetMapping
//    @ApiOperation("查询所有1+X练习表中数据")
//    public ResultT findAll() {
//        return ResultT.success(oneplusxtrainingService.list());
//    }
//
//    /**
//     * 根据Id查询表中数据
//     *
//     * @param id
//     * @return
//     */
//    @GetMapping("/{id}")
//    @ApiOperation("根据Id查询1+X练习表中数据")
//    public ResultT findOne(@PathVariable Integer id) {
//        return ResultT.success(oneplusxtrainingService.getById(id));
//    }
//
//    /**
//     * 分页查询
//     *
//     * @param pageNum
//     * @param pageSize
//     * @return
//     */
//    @GetMapping("/page")
//    @ApiOperation("分页查询1+X练习表中数据")
//    public ResultT findPage(@RequestParam Integer pageNum, @RequestParam Integer pageSize) {
//        QueryWrapper<Oneplusxtraining> queryWrapper = new QueryWrapper<>();
//        return ResultT.success(oneplusxtrainingService.page(new Page<>(pageNum, pageSize), queryWrapper));
//    }
//
//    /**
//     * 新增和更新接口
//     *
//     * @param
//     * @return
//     */
//    @PostMapping
//    @ApiOperation("新增或更新1+X练习表中数据")
//    public ResultT save(@RequestBody Oneplusxtraining oneplusxtraining) {
//        oneplusxtrainingService.saveOrUpdate(oneplusxtraining);
//        return ResultT.success();
//    }
//
//    /**
//     * 根据Id删除表中数据
//     *
//     * @param id
//     * @return
//     */
//    @DeleteMapping("/{id}")
//    @ApiOperation("根据Id删除1+X练习表中数据")
//    public ResultT delete(@PathVariable Integer id) {
//        oneplusxtrainingService.removeById(id);
//        return ResultT.success();
//    }
//
//    /**
//     * 批量删除表中数据
//     *
//     * @param ids
//     * @return
//     */
//    @PostMapping("/del/batch")
//    @ApiOperation("批量删除1+X练习表中数据")
//    public ResultT deleteBatch(@RequestBody List<Integer> ids) {
//        oneplusxtrainingService.removeByIds(ids);
//        return ResultT.success();
//    }
//
//    @PostMapping("/queryByEntity")
//    @ApiOperation("条件查询")
//    public ResultT queryByEntity(Oneplusxtraining oneplusxtraining) {
//        LambdaQueryWrapper<Oneplusxtraining> lqw = new LambdaQueryWrapper<>();
//        lqw.eq(oneplusxtraining.getId() != null, Oneplusxtraining::getId, oneplusxtraining.getId());
//        lqw.eq(oneplusxtraining.getTitle() != null, Oneplusxtraining::getTitle, oneplusxtraining.getTitle());
//        lqw.eq(oneplusxtraining.getStartTime() != null, Oneplusxtraining::getStartTime, oneplusxtraining.getStartTime());
//        lqw.eq(oneplusxtraining.getEndTime() != null, Oneplusxtraining::getEndTime, oneplusxtraining.getEndTime());
//        lqw.eq(oneplusxtraining.getInfo() != null, Oneplusxtraining::getInfo, oneplusxtraining.getInfo());
//        lqw.eq(oneplusxtraining.getType() != null, Oneplusxtraining::getType, oneplusxtraining.getType());
//        lqw.eq(oneplusxtraining.getAttachFile() != null, Oneplusxtraining::getAttachFile, oneplusxtraining.getAttachFile());
//        lqw.eq(oneplusxtraining.getCertTemplate() != null, Oneplusxtraining::getCertTemplate, oneplusxtraining.getCertTemplate());
//        lqw.eq(oneplusxtraining.getSetWidth() != null, Oneplusxtraining::getSetWidth, oneplusxtraining.getSetWidth());
//        lqw.eq(oneplusxtraining.getSetHeight() != null, Oneplusxtraining::getSetHeight, oneplusxtraining.getSetHeight());
//        lqw.eq(oneplusxtraining.getCreateTime() != null, Oneplusxtraining::getCreateTime, oneplusxtraining.getSetHeight());
//        lqw.eq(oneplusxtraining.getStayAtTop() != null, Oneplusxtraining::getStayAtTop, oneplusxtraining.getStayAtTop());
//        lqw.eq(oneplusxtraining.getSortTime() != null, Oneplusxtraining::getSortTime, oneplusxtraining.getSortTime());
//        lqw.eq(oneplusxtraining.getActivityStart() != null, Oneplusxtraining::getActivityStart, oneplusxtraining.getActivityStart());
//        lqw.eq(oneplusxtraining.getActivityEnd() != null, Oneplusxtraining::getActivityEnd, oneplusxtraining.getActivityEnd());
//        lqw.eq(oneplusxtraining.getCoordinate() != null, Oneplusxtraining::getCoordinate, oneplusxtraining.getCoordinate());
//        lqw.eq(oneplusxtraining.getCertNumPrefix() != null, Oneplusxtraining::getCertNumPrefix, oneplusxtraining.getCertNumPrefix());
//
//        List<Oneplusxtraining> oneplusxtrainingList = oneplusxtrainingService.list(lqw);
//        return ResultT.success(oneplusxtrainingList);
//    }
//}
